home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlxhst21.zip
/
TLX_HST.SLT
< prev
next >
Wrap
Text File
|
1990-01-23
|
60KB
|
1,844 lines
////////////////////////////////////////////////////////////////////////
// //
// TLX_HST Script, Version 2.1 //
// //
// For Telix SALT version 3.12 //
// //
// (c) Andrzej Taramina, 1989, 1990 //
// //
////////////////////////////////////////////////////////////////////////
str Copyright[] = "TLX_HST 2.1, Copyright: Andrzej Taramina 1989, 1990";
////////////////////////////////////////////////////////////////////////
// //
// Global variables and storage areas //
// //
////////////////////////////////////////////////////////////////////////
int OK = 0; // Global status codes
int TERMINATE = 99;
int TIMEOUT = 98;
int MSG_BOX_COL = 62;
int MSG_TXT_COL = 48;
str TLX_ERR[] = "TLX_HST 2.1 - ERROR ";
str VERSION[3] = "2.1"; // Version Number
int Global_Status = 0;
str Rom_Level_Str[4] = ""; // Modem rom level
int Rom_Level;
str Main_Menu[1500]; // Main menu storage
int Disp_Menu_Loaded = 0; // subfunction menu storage &
str Disp_Menu[1200]; // loaded flags
int Sets_Menu_Loaded = 0;
str Sets_Menu[1200];
int Regs_Menu_Loaded = 0;
str Regs_Menu[1200];
int Help_Menu_Loaded = 0;
str Help_Menu[1200];
int Test_Menu_Loaded = 0;
str Test_Menu[1200];
int Fone_Menu_Loaded = 0;
str Fone_Menu[1200];
int Comp_Menu_Loaded = 0;
str Comp_Menu[1200];
//
////////////////////////////////////////////////////////////////////////
// //
// Main line code //
// //
////////////////////////////////////////////////////////////////////////
main()
{
int save_scr;
int t1, t2, t3, t4a, t4b, t5;
int stat;
int time_handle;
int old_baud, old_datab, old_parity, old_stopb;
int choice;
int menu_len;
int o1, o2, o3, o4, o5, o6, o7;
str buffer[100];
save_scr = vsavearea(0,0,79,24); // save screen image
clear_scr();
load_scr("menu_mgr"); // Load menu manager
flushbuf();
if (carrier()) // make sure we're offline
{
error_msg("This Script MUST be run OFFLINE (in terminal mode)",
"Script terminated due to above error.","","");
unload_scr("menu_mgr");
vrstrarea(save_scr);
cursor_onoff(1);
return(-1);
}
t1 = track("961",0); // set tracking for rom level
t2 = track("963",0);
t3 = track("964",0);
t4a = track("1440",0);
t4b = track("1441",0);
t5 = track("OK",0);
flushbuf(); // get rom level from modem
cputs("ATI0^M");
time_handle = timer_start(20);
while (1)
{
terminal();
stat = track_hit(0);
if (stat == t1)
{
Rom_Level_Str = "961";
Rom_Level = 961;
break;
}
else if (stat == t2)
{
Rom_Level_Str = "963";
Rom_Level = 963;
break;
}
else if (stat == t3)
{
Rom_Level_Str = "964";
Rom_Level = 964;
break;
}
else if (stat == t4a)
{
Rom_Level_Str = "1440";
Rom_Level = 1440;
break;
}
else if (stat == t4b)
{
Rom_Level_Str = "1441";
Rom_Level = 1441;
break;
}
else if (stat == t5)
break;
else if (time_up(time_handle))
break;
}
track_free(0); // clean up after tracking
timer_free(time_handle);
if (Rom_Level_Str == "") // check for recognized rom
{
error_msg("Sorry, your modem is not a USRobotics Courier HST or",
"the ROM level is higher than 144x or lower than 961.",
"TLX_HST 2.1 Script terminating due to above error.",
"");
unload_scr("menu_mgr");
vrstrarea(save_scr);
cursor_onoff(1);
return(-1);
}
cputs("AT&B0^M");
old_baud = get_baud(); // save old connect parms
old_parity = get_parity();
old_datab = get_datab();
old_stopb = get_stopb();
set_cparams(2400,0,8,1);
_local_echo = 1;
call("menu_mgr","l",Main_Menu,"tlx_hstm",menu_len);
call("menu_mgr","p",Main_Menu,Rom_Level_Str,13);
if (Rom_Level < 964)
{
call("menu_mgr","ga",Main_Menu,buffer,5,o1,o2,o3,o4,o5,o6,o7);
call("menu_mgr","pa",Main_Menu,buffer,5,'O',o2,o3,56,o5,o6,o7);
}
while (Global_Status == OK) // main menu display loop
{
choice = call("menu_mgr","d",Main_Menu,buffer,0,1,0,0);
call("menu_mgr","r");
cursor_onoff(1);
update_term();
if (choice == 1) // do Telix setup?
telix_def();
else if (choice == 2) // do PCBoard setup?
pcboard_def();
else if (choice == 3) // display subfunctions?
submenu_disp();
else if (choice == 4) // set subfunctions?
submenu_sets();
else if (choice == 5) // data compression subfns?
submenu_comp();
else if (choice == 6) // phone # subfunctions?
submenu_fone();
else if (choice == 7) // test subfunctions?
submenu_test();
else if (choice == 8) // help subfunctions?
submenu_help();
else if (choice == 9) // exit?
{
Global_Status = TERMINATE;
break;
}
if (choice == 1 or choice == 2) wait_for_key();
}
if (Global_Status == TIMEOUT) // did we get a timeout?
{
error_msg("WAITFOR timeout on current modem operation,",
"Reply not received within 20 seconds.",
"TLX_HST 2.1 Script terminating due to above error.",
"");
}
// reset everything before exiting TLX_HST
set_cparams(old_baud,old_parity,old_datab,old_stopb);
_local_echo = 1;
unload_scr("menu_mgr");
cursor_onoff(1);
vrstrarea(save_scr);
return(0);
}
//
////////////////////////////////////////////////////////////////////////
// //
// Process "Display" submenu //
// //
////////////////////////////////////////////////////////////////////////
submenu_disp()
{
int done = 0;
int choice;
int menu_len;
str buffer[100];
if (! Disp_Menu_Loaded)
{
call("menu_mgr","l",Disp_Menu,"tlx_hstd",menu_len);
Disp_Menu_Loaded = 1;
}
while (! done and Global_Status == OK) // display submenu loop
{
choice = call("menu_mgr","d",Disp_Menu,buffer,0,1,0,0);
call("menu_mgr","r");
cursor_onoff(1);
update_term();
if (choice == 1) // display rom level?
get_level();
else if (choice == 2) // display memory checksum?
chk_sum();
else if (choice == 3) // display ram settings?
current_set();
else if (choice == 4) // display nram settings?
nram_set();
else if